
import request from "@/request/request.js";

export default{
    wxLogin:"/login/wx",//微信登录
    getBankList:"/bank/list",//全部银行列表
    bankAdd:"/user/bank/add",//绑定新银行卡提交
    userBankList:"/user/bank/list",//获取用户绑定的银行卡列表
    getUserBankInfo:"/user/bank/info",//用户绑定银行卡详情获取
    deleteBank:"/user/bank/delete",//解绑银行卡
    getScoreList:"/user/score/list",//获取积分明细
    userScoreStatistics:'/user/score/statistics',//我的页面-获取积分收益详情
    userScoreUsable:"/user/score/usable",//积分可提现余额
    userScoreTake:"/user/score/take",//积分提现
    apparatusCount:"/user/apparatus/count",//获取全部水机数量
    apparatusList:"/user/apparatus/list",//获取水机列表
    vipList:"/vip/list",//获取全员vip类型
    vipInfo:"/user/vip/info",//获取用户vip情况
    vipRedeem:"/user/vip/redeem",//会员兑换
    userAgreement:"/user/agreement",//协议
}

/**
 * 手机号注册
 * @param object data
 *
 */
export function phoneRegister(data) {
    return request.post('apicrzs/auth/register', data, {
        noAuth: true
    });
}

export function phoneRetrieve(data) {
    return request.post('apicrzs/auth/retrieve', data, {
        noAuth: true
    });
}
export function bindingUserPhone(data) {
    return request.put('apicrzs/user/binding', data);
}

/**
 * 手机+密码 登录
 * @param data
 * @returns {*}
 */
export function phoneLogin(data) {
    // return request.post('', data, {
    return request.post('apicrzs/auth/login', data, {
        noAuth: true
    });
}

/**
 * 手机号修改密码
 * @param data
 * @returns {*}
 */
export function phoneRegisterReset(data) {
    return request.post('apicrzs/auth/register/reset', data, {
        noAuth: true
    })
}

/**
 * 获取短信KEY
 * @param object phone
 */
export function verifyCode() {
    return request.post('apicrzs/auth/verifykey', {}, {
        noAuth: true
    })
}

/**
 * 验证码发送
 * @param object phone
 */
export function registerVerify(phone, reset, key) {
    return request.post('apicrzs/auth/verifycode', {
        phone: phone,
        type: reset === undefined ? 'reset' : reset,
        key: key
    }, {
        noAuth: true
    })
}
/**
 * 协议
 * @param object phone
 */
export function userAgreement() {
    return request.post('apicrzs/user/agreement', {}, {
        noAuth: true
    })
}
